<div id="datas_list">
    <?php
    echo CHtml::beginForm(array('links/delete'), 'post', array(
        'onSubmit' => "return fnOnSubmitDeleteConfirm('"
            . CHtml::encode(Yii::t('jsmsg', 'confirm_delete'))
            . '\',\'' . Yii::t('jsmsg', 'unselect_tips') . "');"
    ));
    ?>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" class="datas_grid">
        <thead>
            <tr>
                <th><input type="checkbox" id="checkallboxs" onclick="$('input[name=\'delete[]\']').attr('checked', this.checked);" /></th>
                <th><?php echo $sort->link('name'); ?></th>
                <th><?php echo $sort->link('type'); ?></th>
                <th>&nbsp;</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <td>
                    <?php
                    echo CHtml::imageButton(Yii::app()->baseUrl . '/assets/backend/images/action_delete.png');
                    ?>
                </td>
                <td colspan="3">
                    <?php $this->widget('BackendPager', array('pages' => $pages)); ?>
                </td>
            </tr>
        </tfoot>
        <tbody>
            <?php foreach($models as $n => $model): ?>
            <tr class="<?php echo ($n % 2) ? 'even' : 'odd'; ?>">
                <td class="sn_and_checkbox">
                    <input type="checkbox" id="delete_<?php echo $model->id; ?>" name="delete[]" value="<?php echo $model->id; ?>">
                        <?php echo sprintf("%04d", ++$n + $pages->getCurrentPage() * $pages->getPagesize()); ?>
                </td>
                <td><?php echo CHtml::encode($model->name); ?></td>
                <td><?php echo CHtml::encode($model->typeTextFormat); ?></td>
                <td class="action_one">
                    <?php
                    echo CHtml::link(CHtml::image(Yii::app()->baseUrl . '/assets/backend/images/btn_edit.png'),
                    array('update', 'id' => $model->id)
                    );
                    ?>
                </td>
            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    <?php echo CHtml::endForm(); ?>
</div>